A machine tool such as a chip mounter for attaching workpieces to a substrate is used to mount workpieces such as electronic components on a substrate. In the machine tool, a servo-controlled linear motor is used for movement in the vertical direction when attaching a workpiece to a substrate. With the linear motor that moves a movable element in the vertical direction, there is a possibility that, when the servo control starts, the movable element may drop due to gravity such that it is displaced from a target position. There is a technology which prevents displacement of the movable element due to an external force such as gravity at the start of servo control or the like by generating a thrust force for correcting a current that flows through a motor to cancel out the external force (Patent Literature 1).